package com.ocom.common.enums;

import com.alibaba.fastjson.JSON;
import com.ocom.common.utils.CommonUtil;
import com.ocom.common.vo.KVSelectedVo;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/5/31
 **/
public enum ExcelDownLoadEnum {

	consumeDetail("/consume/report/detail","[\n" +
			"    {\n" +
			"    \"key\" : 0,\n" +
			"    \"name\" : \"单位编号\",\n" +
			"    \"field\" : \"comId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 1,\n" +
			"    \"name\" : \"账户名\",\n" +
			"    \"field\" : \"accountNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 2,\n" +
			"    \"name\" : \"管理员Id\",\n" +
			"    \"field\" : \"adminId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 3,\n" +
			"    \"name\" : \"卡码内容\",\n" +
			"    \"field\" : \"cardNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 4,\n" +
			"    \"name\" : \"现金钱余额\",\n" +
			"    \"field\" : \"chargeBalance\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 5,\n" +
			"    \"name\" : \"充值区发生金额\",\n" +
			"    \"field\" : \"chargeMoney\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 6,\n" +
			"    \"name\" : \"消费金额\",\n" +
			"    \"field\" : \"consMoney\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 7,\n" +
			"    \"name\" : \"消费状态\",\n" +
			"    \"field\" : \"consState\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 8,\n" +
			"    \"name\" : \"消费时间\",\n" +
			"    \"field\" : \"consTime\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 9,\n" +
			"    \"name\" : \"消费类型\",\n" +
			"    \"field\" : \"consType\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 10,\n" +
			"    \"name\" : \"创建时间\",\n" +
			"    \"field\" : \"createTime\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 11,\n" +
			"    \"name\" : \"部门ID\",\n" +
			"    \"field\" : \"deptId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 12,\n" +
			"    \"name\" : \"部门名称\",\n" +
			"    \"field\" : \"deptName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 13,\n" +
			"    \"name\" : \"消费机名称\",\n" +
			"    \"field\" : \"deviceName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 14,\n" +
			"    \"name\" : \"消费机编号\",\n" +
			"    \"field\" : \"deviceNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 15,\n" +
			"    \"name\" : \"折扣\",\n" +
			"    \"field\" : \"discount\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 16,\n" +
			"    \"name\" : \"折扣方式\",\n" +
			"    \"field\" : \"discountWay\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 17,\n" +
			"    \"name\" : \"人脸\",\n" +
			"    \"field\" : \"face\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 18,\n" +
			"    \"name\" : \"原订单是否退款\",\n" +
			"    \"field\" : \"ifRefund\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 19,\n" +
			"    \"name\" : \"退款笔数\",\n" +
			"    \"field\" : \"ifRefund\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 20,\n" +
			"    \"name\" : \"餐段归属日期\",\n" +
			"    \"field\" : \"mealDate\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 21,\n" +
			"    \"name\" : \"餐段名称\",\n" +
			"    \"field\" : \"mealName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 22,\n" +
			"    \"name\" : \"餐段编号（1-99）\",\n" +
			"    \"field\" : \"mealNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 23,\n" +
			"    \"name\" : \"商户ID\",\n" +
			"    \"field\" : \"merchId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 24,\n" +
			"    \"name\" : \"商户名称\",\n" +
			"    \"field\" : \"merchName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 25,\n" +
			"    \"name\" : \"月份\",\n" +
			"    \"field\" : \"monthValue\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 26,\n" +
			"    \"name\" : \"操作类型\",\n" +
			"    \"field\" : \"opType\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 27,\n" +
			"    \"name\" : \"具体操作方式\",\n" +
			"    \"field\" : \"opTypeDiff\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 28,\n" +
			"    \"name\" : \"订单号\",\n" +
			"    \"field\" : \"orderNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 29,\n" +
			"    \"name\" : \"原支付订单号（退款时保存）\",\n" +
			"    \"field\" : \"origOrderNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 30,\n" +
			"    \"name\" : \"员工编号\",\n" +
			"    \"field\" : \"pCode\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 31,\n" +
			"    \"name\" : \"人员ID\",\n" +
			"    \"field\" : \"pId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 32,\n" +
			"    \"name\" : \"姓名\",\n" +
			"    \"field\" : \"pName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 33,\n" +
			"    \"name\" : \"人脸2\",\n" +
			"    \"field\" : \"pPhotoUrl2\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 34,\n" +
			"    \"name\" : \"通道实际支付金额\",\n" +
			"    \"field\" : \"payAmount\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 35,\n" +
			"    \"name\" : \"统一支付平台通道编号\",\n" +
			"    \"field\" : \"payChannelNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 36,\n" +
			"    \"name\" : \"支付状态\",\n" +
			"    \"field\" : \"payState\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 37,\n" +
			"    \"name\" : \"支付时间\",\n" +
			"    \"field\" : \"payTime\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 38,\n" +
			"    \"name\" : \"平台订单号\",\n" +
			"    \"field\" : \"platOrderNo\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 39,\n" +
			"    \"name\" : \"收费点ID\",\n" +
			"    \"field\" : \"pointId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 40,\n" +
			"    \"name\" : \"收费点名称\",\n" +
			"    \"field\" : \"pointName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 41,\n" +
			"    \"name\" : \"实际发生金额\",\n" +
			"    \"field\" : \"realMoney\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 42,\n" +
			"    \"name\" : \"退款时间\",\n" +
			"    \"field\" : \"refundTime\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 43,\n" +
			"    \"name\" : \"补贴余额\",\n" +
			"    \"field\" : \"subBalance\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 44,\n" +
			"    \"name\" : \"补贴区发生金额\",\n" +
			"    \"field\" : \"subMoney\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 45,\n" +
			"    \"name\" : \"补贴金额\",\n" +
			"    \"field\" : \"subsidy\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 46,\n" +
			"    \"name\" : \"预留字段1\",\n" +
			"    \"field\" : \"reserved1\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 47,\n" +
			"    \"name\" : \"预留字段2\",\n" +
			"    \"field\" : \"reserved2\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 48,\n" +
			"    \"name\" : \"预留字段3\",\n" +
			"    \"field\" : \"reserved3\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 49,\n" +
			"    \"name\" : \"通道号\",\n" +
			"    \"field\" : \"payWay\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 50,\n" +
			"    \"name\" : \"手续费\",\n" +
			"    \"field\" : \"channelFee\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 51,\n" +
			"    \"name\" : \"消费账户类型\",\n" +
			"    \"field\" : \"accTypeId\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 52,\n" +
			"    \"name\" : \"餐段名称\",\n" +
			"    \"field\" : \"mealName\",\n" +
			"    \"select\" :  true\n" +
			"    },\n" +
			"    {\n" +
			"    \"key\" : 53,\n" +
			"    \"name\" : \"消费笔数（厦门定制）\",\n" +
			"    \"field\" : \"countPay\",\n" +
			"    \"select\" :  false\n" +
			"    }\n" +
			"]" ),
	CCB("/main","[]");

	private final String key;
	private final String value;

	ExcelDownLoadEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}


	/**
	 * 根据key获取value
	 *
	 * @param key : 键值key
	 * @return String
	 */
	public static List<KVSelectedVo> getValueByKey(String key) {
		ExcelDownLoadEnum[] enums = ExcelDownLoadEnum.values();
		for (int i = 0; i < enums.length; i++) {
			if (enums[i].getKey().equals(key)) {
				if(CommonUtil.isNull(enums[i].getValue())) 	return new ArrayList<>();
				return JSON.parseArray(enums[i].getValue(),KVSelectedVo.class);
			}
		}
		return new ArrayList<>();
	}


	public static void main(String[] args){
		System.out.println(ExcelDownLoadEnum.getValueByKey("/consume/report/detail"));
	}

}
